package com.cc.blog.service.impl;

import com.cc.blog.service.LogoutService;
import com.cc.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LogoutServiceImpl implements LogoutService {

    @Resource
    private RedisTemplate<String,String> redisTemplate;

    @Override
    public Result logout(String token) {
        redisTemplate.delete("Token: " + token);
        return Result.success(null);
    }
}
